An Automatic Commercial Garage
Introduction










<























<






This is a project for our integrated technology class. Our group members are Janis Moriarity, Mitchell Pike, and Mark Benson(as seen in the picture holding our garage). The responsiblities were: Me(Janis)program writer, and writer of other miscellanous details, creator of this website, Mark and Mitchell the designers of the garage and slideshow creators. This is an interesting project and the following is an idea of how it got started. Our first idea for a project started off as a windmill but because this was too simple, no real problem to solve, we started to look for another idea. The next idea was the garage door but we wanted to do something a little different so we decided to do the whole garage. The garage would be a commercial garage (as a normal garage would be very similar to a garage door) there would be an exit and entrance door. The first idea for the doors was to put them on both on the same side, this could not work because it would be hard to show anyone what was happening inside the garage. Also the motors and switches would end up being very close together. We also considered leaving a side out of the garage so that people could see what we were doing but that would take away from the look of the project and people can see down from the top ok anyway. So we decided to go with one on each end, 4 switches as shown later. Then we decided what to make the garage out of. We thought about a large cardboard box, popsicle sticks, and elastic bands but these would not be very strong and Mark decided to make a wooden garage at home. The next thing was to decide where the switches would go and how they would be used. The first switch would be put up through a hole in the garage, outside the door. The second one also but the third would be put through a handmade lever, which would be attached to the side of the garage. The third would be used the same way as the first and second. A problem with this was that since the switches are small there is no guarantee that the switch would be hit by a car so we decided to use a light piece of cardboard and a cardboard hinge. When the car hits this piece of cardboard it would press on the switch assuming the car was heavy enough, which real cars would be. Once the garage was built by Mark deciding how to get the switches hooked up was faster. The next section is our basic drawing for the garage.














The basic sketch and idea



































An advertisement for fortune city. In the meantime why not check out the link below to get your own 20MB of free webspace?

www.fortunecity.com



This is a picture of our idea for the garage, showing where all the switches will be and the order of things. This is a description of the garage. A car will drive up to the first door and run over a switch, the switch will cause the door to open, the door will not close until the car runs over a second switch located inside the door. To leave the garage the person must push a button (located in a reachable position inside the door) to open the door and then once they drive out they will run over another switch closing the door. This will make sure that no car will get hit by a closing door. The first idea we settled on was to have only 2 switches used, one to open and close the first door, the other to open and close the second but because this would not leave a chance for everyone to make it through on time and in case there was an emergeny there would be no guarantee the door would not close on them. So we changed our design to the one shown here. Once we finally had the model made (out of wood putting everything together was not very easy, we had measured the switches and motors to a certain length from the door and the holes were cut a little longer than expected. Also we did not have time to discover if the motors were strong enough to pull open the door since no working motors were available and it took a long time to get set up. The one motor we did have only worked some of the time because of the card used and by the time it was hooked up and working we did not have time to test the project.









The Programming

The code started out as a basic program that was written by our teacher. Programming done on stemnet helped me prepare for changing the code for our benefit. I also talked to people from other groups to figure out how they were handling the code. My first idea was to create the code so that one switch would open, stop and close the door, as mentioned above, this would not have accounted well for people getting hit by the garage door if they had a problem. So I decided to put an emergency button on the side of the door. This would have worked except someone would have to get out of the car to press the button and this might cause them to be killed. So I had to start over again to create a code that would not allow the door to close until the car was through. Originally I had all the programming spread out, every button worked a switch etc. so first I had to move all the programming up under one button (the forward button) and get rid of all the unnecessary pieces of the code. Then I decided to go with four switches to make allowances for emergencies. One switch to open the first door, one to close the first door, a button to open the second door, and a switch to close the second door. Once this was set up I had to figure out a way to get the switches to work without pressing a button for every switch. I then created a loop so when that button was pressed the program would not need anymore buttons used. Another problem was getting the program to work with the motors and trying only to do one part of the program at a time. The pcgadgets card took a long time to set up and finding a motor to work took awhile. Once I had one working I starting trying another one, I had to try many combinations of which wire should be started with, without success. However, I do know the program works with a working card and motor so once one presentation is over we can use the motor from that presentation. One more problem was trying to get connected to the internet to work on the programs in stemnet, it took awhile before I could get started on my own code.

The code

'Declares Variables
Dim a(10), D,N,S
Private Sub Command1_Click( )
'N - gets value from scroll bar
N = HScroll.Value
Do
'first motor turns forward when switch is pressed
If(Inp(889) And 64) = 64 Then
For i = i to N
Text1 = i
Text1. Refresh
Call forward
Next i
Out 888, 0
End If
'first motor turns reverse when switch is pressed
If(Inp(889) And 128) = 128 Then
For i = i to N
Text1 = i
Text1. Refresh
Call Reverse
Next i
Out 888, 0
End If
'second motor turns forward when switch is pressed
If(Inp(889) And 32) = 32 Then
For i = i to N
Text1 = i
Text1. Refresh
Call Forward2
Next i
Out 888, 0
End If
'second motor turns reverse when switch is pressed
If(Inp(889) And 16) = 16 Then
For i = i to N
Text1 = i
Text1. Refresh
Call Reverse2
Next i
Out 888, 0
End If

Private Sub Form_Load( )
a(1) = 128
a(2) = 64
a(3) = 32
a(4) = 16
a(5) = 8
a(6) = 4
a(7) = 2
a(8) = 1
End Sub

'Allows label to show scroll bar value rotations
Private Sub HScroll1. Value
End Sub

'allows label to show scroll bar value for speed
Private Sub HScroll2_Change( )
Label4.Caption = HScroll2.Value
End Sub

Public Sub Forward( )
'makes motor turn forward

If S < 4 Then
S = S + 1
Else
S = 1
Call delay
End If
Out 888, a(s)
delay
End Sub

Public Sub reverse( )
'makes motor reverse
If S > 1 Then
S = S - 1
Else
S = 1
Call delay
End If
Out 888, a(s)
delay
End Sub

Public Sub forward2( )
'second motor turns forward
If S < 8 Then
S = S + 1
Else
S = 1
Call delay
End If
Out 888, a(s)
delay
End Sub

Public Sub reverse2( )
'second motor turn reverse
If S < 8 Then
S = S + 1
Else
S = 1
Call delay
End If
Out 888, a(s)
delay
End Sub

Public Sub delay( )
'creates a delay
D = HScroll2.Value
D = D * 5000
For T = 1 To D: Next T
End Sub





Further problems encountered in our project were trying to make sure everyone was on the "same page". We had to make sure we all wanted the same thing and alot of decisions were left to majority rule such as the slide show.
I would have changed some of the things we did such as having some of the work being shared. For example, the slide show was saved under Mark's account and when it was lost so was all the writing I did for it. Also it would have given us a better idea of what to do every day.






Conclusion:
This was an interesting and fun project to try. It taught us alot about presentations, programming and pcgadgets card. We got to try things that we had not tried before. If we could change things I think the responsiblities would have been separated more, giving us all something to do, at all times and also I would have worked with more people on the code and tried to work things out a little more before I asked how they were done. Also the presentations would have gotten more concentration and so would the attachment of the motors and switches to the garage. The doors of the garage would have been lighter and easier for the motors to pull. Also we had to change the string used at the last moment because strong nylon was too hard for the motors to grip. In all it was a success but would be changed if we had the time.







Favourite Links

Email me on:
[email protected]

This page has been visited times.